Only auto-insert the prefix if we are at the end of the text
authorFederico Mena Quintero <federico@gnu.org>
Thu, 13 Mar 2008 00:26:20 +0000 (00:26 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Thu, 13 Mar 2008 00:26:20 +0000 (00:26 +0000)
Signed-off-by: Federico Mena Quintero <federico@gnu.org>
svn path=/trunk/; revision=19799

gtk/gtkfilechooserentry.c

index 9b5f3dbdba4af8da6423a8fbbf6bb71f30ea7af2..d07a53776d1ebffc97c7b7b0c3944d51548c393c 100644 (file)
@@ -558,8 +558,9 @@ check_completion_callback (GtkFileChooserEntry *chooser_entry)
    * the "open" modes.  For "save" modes, the user must hit Tab to cause the prefix
    * to be inserted.  That happens in gtk_file_chooser_entry_focus().
    */
-  if (chooser_entry->action == GTK_FILE_CHOOSER_ACTION_OPEN
-      || chooser_entry->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+  if ((chooser_entry->action == GTK_FILE_CHOOSER_ACTION_OPEN
+       || chooser_entry->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+      && gtk_editable_get_position (GTK_EDITABLE (chooser_entry)) == GTK_ENTRY (chooser_entry)->text_length)
     append_common_prefix (chooser_entry, TRUE);
 
  done: